package com.clss.commandhelper.function.caseAddInformation;

import android.content.Context;

import com.clss.commandhelper.base.BaseJson;
import com.clss.commandhelper.base.BaseModel;
import com.clss.commandhelper.net.ApiClient;
import com.clss.commandhelper.tools.SpHelper;
import com.google.gson.Gson;

import okhttp3.RequestBody;
import retrofit2.Callback;

/**
 * Created by Administrator on 2017/11/27.
 */

public class CaseAddInformationModel extends BaseModel {
    public CaseAddInformationModel(Context context) {
        super(context);
    }

    public void addCaseInfo(AddInfoTask addInfoTask, Callback<BaseJson> callback){
        Gson gson = new Gson();
        String json = gson.toJson(addInfoTask);
        RequestBody body= RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"),json);
        mCall = ApiClient.apiList.addCaseInfo(SpHelper.getInstance().getToken(), body);
        mCall.enqueue(callback);
    }
}
